Generalised folds for nested datatypes
نویسندگان
چکیده
منابع مشابه
Nested Datatypes
A nested datatype, also known as a non-regular datatype, is a parametrised datatype whose declaration involves different instances of the accompanying type parameters. Nested datatypes have been mostly ignored in functional programming until recently, but they are turning out to be both theoretically important and useful in practice. The aim of this paper is to suggest a functorial semantics fo...
متن کاملMonadic Maps and Folds for Arbitrary Datatypes
Each datatype constructor comes equiped not only with a so-called map and fold (catamorphism), as is widely known, but, under some condition, also with a kind of map and fold that are related to an arbitrary given monad. This result follows from the preservation of initiality under lifting from the category of algebras in a given category to a certain other category of algebras in the Kleisli c...
متن کامل(Co-)Iteration for Higher-Order Nested Datatypes
The problem of defining iteration for higher-order nested datatypes of arbitrary (finite) rank is solved within the framework of System F of higher-order parametric polymorphism. The proposed solution heavily relies on a general notion of monotonicity as opposed to a syntactic criterion on the shape of the type constructors such as positivity or even being polynomial. Its use is demonstrated fo...
متن کاملPolytypic Functions Over Nested Datatypes
The theory and practice of polytypic programming is intimately connected with the initial algebra semantics of datatypes. This is both a blessing and a curse. It is a blessing because the underlying theory is beautiful and well developed. It is a curse because the initial algebra semantics is restricted to so-called regular datatypes. Recent work by R. Bird and L. Meertens [3] on the semantics ...
متن کاملRepresenting Cyclic Structures as Nested Datatypes
We show that cyclic structures, i.e., finite or possibly infinite structures with backpointers, unwindable into possibly infinite structures, can be elegantly represented as nested datatypes. This representation is free of the various deficiencies characterizing the more naive representation as mixed-variant datatypes. It is inspired by the representation of lambda-terms as a nested datatype vi...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
ژورنال
عنوان ژورنال: Formal Aspects of Computing
سال: 1999
ISSN: 0934-5043,1433-299X
DOI: 10.1007/s001650050047